package xcmg.device.dao.mapper.announcement;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.account.ArapDO;
import xcmg.device.dao.entity.announcement.BasicAttachmentDO;
import xcmg.device.service.vo.account.ArapVO;
import xcmg.device.service.vo.announcement.BasicAttachmentVO;

import java.util.List;

/**
 * 附件mapper
 * @Author huhuawei
 */
@Mapper
public interface BasicAttachmentMapper {

    /**
     * 根据ID删除附件信息
     * @param id
     * @return
     */
    int deleteByPrimaryKey(String id);

    /**
     * 新增附件信息
     * @param record
     * @return
     */
    int insert(BasicAttachmentVO record);

    /**
     * 根据ID查询单条附件信息
     * @param id
     * @return
     */
    BasicAttachmentDO selectByPrimaryKey(String id);

    /**
     * 更新附件信息
     * @param record
     * @return
     */
    int update(BasicAttachmentVO record);

    /**
     * 根据前端传入的相应条件
     * 获取附件信息列表
     * @param condition
     * @return
     */
    List<BasicAttachmentDO> list(BasicAttachmentVO condition);

    /**
     * 删除该条附件公告信息
     * 更改is_del  的状态
     * @param ids
     * @return
     */
    int updateDel(@Param("ids") List<String> ids);

    /**
     * 根据announcementId删除该条附件公告信息
     * 更改is_del  的状态
     * @param announcementId
     * @return
     */
    int updateDelByAnnouncementId(@Param("announcementId") String announcementId);

    /**
     * 根据announcementId和公告ID查询出当前新增的px值
     * 已删除的也算在基数之内
     * @param announcementId
     * @return
     */
    int countPxByAnnouncementId(@Param("announcementId") String announcementId);
}